import { IsNumber, IsOptional, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class QueryGoodsDto {
  @ApiProperty({ description: '页码', required: false, default: 1 })
  @IsNumber()
  @IsOptional()
  pageNum?: number = 1;

  @ApiProperty({ description: '每页数量', required: false, default: 10 })
  @IsNumber()
  @IsOptional()
  pageSize?: number = 10;

  @ApiProperty({ description: '商品标题', required: false })
  @IsString()
  @IsOptional()
  title?: string;

  @ApiProperty({ description: '商品分类ID', required: false })
  @IsNumber()
  @IsOptional()
  categoryId?: number;

  @ApiProperty({ description: '最低价格', required: false })
  @IsNumber()
  @IsOptional()
  minPrice?: number;

  @ApiProperty({ description: '最高价格', required: false })
  @IsNumber()
  @IsOptional()
  maxPrice?: number;

  @ApiProperty({ description: '商品状态', required: false })
  @IsNumber()
  @IsOptional()
  status?: number;

  @ApiProperty({ description: '卖家ID', required: false })
  @IsNumber()
  @IsOptional()
  sellerId?: number;
}
